<%@page import="it.apuliait.service.DocumentoLocalServiceUtil"%>
<%@page import="it.apuliait.model.Documento"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="javax.portlet.ActionRequest"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

<script type="text/javascript" src="<%= request.getContextPath() %>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/ui.datepicker-it.js"></script>
<link href="<%= request.getContextPath() %>/css/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/ui.datepicker.css" rel="stylesheet" type="text/css" />

<portlet:defineObjects />
<%
PortletURL aggiungiDatiPagamentoURL = renderResponse.createActionURL();
aggiungiDatiPagamentoURL.setParameter(ActionRequest.ACTION_NAME, "aggiungiDatiPagamento");
aggiungiDatiPagamentoURL.setParameter("action", "ADD");

String documentoId = (String)renderRequest.getAttribute("documentoId");
aggiungiDatiPagamentoURL.setParameter("documentoId", documentoId);
Documento documento = DocumentoLocalServiceUtil.getDocumento(Long.valueOf(documentoId));

%>
<script type="text/javascript">
  $(document).ready(function(){
 	$('#datepicker').datepicker({ dateFormat: 'yy-mm-dd' });
  }); 
  $(document).ready(function(){
	 	$('#datepicker1').datepicker({ dateFormat: 'yy-mm-dd' });
	  }); 
  $(document).ready(function(){
	 	$('#datepicker2').datepicker({ dateFormat: 'yy-mm-dd' });
	  }); 
  $(document).ready(function(){
	 	$('#datepicker3').datepicker({ dateFormat: 'yy-mm-dd' });
	  }); 
</script>
<form action="<%= aggiungiDatiPagamentoURL %>" method="post">
	<table border="0" width="100%">
		<tr>
			<td colspan="5" style="border-bottom-style: solid; border-bottom-color: #118ADE;">
				<table width="100%">
					<tr>
						<td><B>MODALITA' DI PAGAMENTO PER IL DOCUMENTO:</B> <%= documento.getNomeDocumento() %></td>
						<td align="right" colspan="4"><b>TOTALE:</b> <%= documento.getImportoTotale() %> &euro;</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td>CONDIZIONI DI PAGAMENTO</td>
			<td colspan="5">
				<select name="<portlet:namespace />condizioniPagamento" style="width: 100%">
					<option selected="selected"></option>
					<option value="TP01">PAGAMENTO A RATE</option>
					<option value="TP02">PAGAMENTO COMPLETO</option>
					<option value="TP03">ANTICIPO</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>BENEFICIARIO</td>
			<td colspan="4"><input type="text" name="<portlet:namespace />beneficiario" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>MODALITA PAGAMENTO</td>
			<td colspan="4">
				<select name="<portlet:namespace />modalitaPagamento" id="modalitaPagamento" style="width: 80%" onchange="table()">
					<option selected="selected"></option>
					<option value="MP01">CONTANTI</option>
					<option value="MP02">ASSEGNO</option>
					<option value="MP03">ASSEGNO CIRCOLARE</option>
					<option value="MP04">CONTANTI PRESSO TESORERIA</option>
					<option value="MP05">BONIFICO</option>
					<option value="MP06">VAGLIA CAMBIARIO</option>
					<option value="MP07">BOLLETTINO BANCARIO</option>
					<option value="MP08">CARTA DI PAGAMENTO</option>
					<option value="MP09">RID</option>
					<option value="MP010">RID UTENZE</option>
					<option value="MP011">RID VELOCE</option>
					<option value="MP012">RIBA</option>
					<option value="MP013">MAV</option>
					<option value="MP014">QUIETANZA ERARIO</option>
					<option value="MP015">GIROCONTO SU CONTI DI CONTABILITA SPECIALE</option>
					<option value="MP016">DOMICILIAZIONE BANCARIA</option>
					<option value="MP017">DOMICILIAZIONE POSTALE</option>
					<option value="MP018">BOLLETTINO CI C/C POSTALE</option>
					<option value="MP019">SEPA DIRECT DEBIT</option>
					<option value="MP020">SEPA DIRECT DEBIT CORE</option>
					<option value="MP021">SEPA DIRECT DEBIT B2B</option>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="5" style="border-bottom-style: solid; border-bottom-color: #118ADE"><B>BONIFICO BANCARIO</B></td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%">NOME BANCA</td>
			<td colspan="4"><input type="text" name="<portlet:namespace />istitutoFinanziario" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>IBAN</td>
			<td colspan="4"><input type="text" name="<portlet:namespace />iban" id="iban" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>ABI</td>
			<td><input type="text" name="<portlet:namespace />abi" size="5" id="abi" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>CAB</td>
			<td><input type="text" name="<portlet:namespace />cab" size="5" id="cab" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>BIC</td>
			<td colspan="4"><input type="text" name="<portlet:namespace />bic" id="bic" size="11" style="width: 80%" /></td>
		</tr>
		<tr>
			<td colspan="5" style="border-bottom-style: solid; border-bottom-color: #118ADE"><B>UFFICIO POSTALE</B></td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td>CODICE UFFICIO POSTALE</td>
			<td><input type="text" name="<portlet:namespace />codUfficioPostale" size="5" id="abi" style="width: 80%" /></td>
		</tr>
		<tr>
			<td colspan="5" style="border-bottom-style: solid; border-bottom-color: #118ADE"><B>CONTANTI</B></td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td>COGNOME QUETANZIANTE</td>
			<td><input type="text" name="<portlet:namespace />cognomeQuetanziante" size="5" id="abi" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>NOME QUETANZIANTE</td>
			<td><input type="text" name="<portlet:namespace />nomeQuetanziante" size="5id="abi" style="width: 80%" /></td>
		</tr>
		<tr>
			<td>CODICE FISCALE QUETANZIANTE</td>
			<td><input type="text" name="<portlet:namespace />CFQuetanziante" size="5" id="abi" style="width: 80%" /></td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="5"><input type="submit" value="Salva" /></td>
		</tr>
</table>